home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #1 / Amiga Plus 1995 #1.iso / fish-disketten / fish_651-660 / d659 / mungwall / mungwall.doc < prev    next >
Text File  |  1994-12-13  |  6KB  |  129 lines

  1. 20-Apr-92 Mungwall 37.51 doc.
  2.  
  3. Mungwall munges memory and watches for illegal FreeMem's.
  4. Mungwall is especially useful in combination with Enforcer.
  5. Output is either serial or parallel (mungwall.par).
  6.  
  7. New (37.49) MungWall NAMETAG option tags each allocation with the name
  8. of the allocator.  The new "MUNGLIST" program examines used memory areas
  9. for mungwall tag info, and outputs a list of who owns the various
  10. pieces of allocated memory, their sizes, etc.  If you have used the
  11. NAMETAG option of MungWall, this list will include the name of the
  12. task or command that allocated the memory.  Note that certain
  13. allocations belonging to your program may be displayed as belonging
  14. to another task (such as the task of a disk device that you
  15. locked a file on or accessed).
  16.  
  17. Mungwall 37.51 adds an AvailMem wedge which reduces reported available
  18. memory by the size which Mungwall will add to any allocation.  It also
  19. correct a problem which had caused the NAMETAG option to crash on a
  20. 68000.
  21.  
  22. Memory munging:
  23.  
  24.  - Except when Enforcer is running, location 0 is set to $C0DEDBAD, i.e.
  25.    programs referencing location zero will not f.e. find a null string.
  26.  
  27.  - On startup all free memory is munged with $ABADCAFE. If this number
  28.    shows up, someone is referencing memory in the free list.
  29.  
  30.  - Except when MEMF_CLEAR is set, memory is pre-munged on allocation with
  31.    $DEADFOOD. When this is used in an Enforcer report, the caller is
  32.    allocating memory and doesn't initialize it before using it. Note that
  33.    only memory which has a cookie attached will be pre-munged.
  34.  
  35.  - Memory is filled with $DEADBEEF before it is freed, encouraging
  36.    programs reusing free'ed memory to crash.
  37.  
  38. Memory watching:
  39.  
  40. Mungwall places a magic cookie before the memory allocation.
  41. Along with a wall of bytes on either side of the allocation to keep an
  42. eye on the memory just before or after the allocation. If the
  43. memory wall is trashed, mungwall complains and shows the damaged area.
  44. If memory is trashed so bad that the cookie is completely gone, Mungwall
  45. will not consider it a walled memory allocation and lets it go. Changes
  46. are you'll be corrupting the memory list and/or overwriting other memory
  47. allocation and crash soon after that. If a mungwall hit occurs, memory
  48. will not be munged or free'ed, to give you a change to look at what was
  49. written there.
  50.  
  51. Both null pointer FreeMem()'s and null sized Alloc/FreeMem()'s trigger
  52. mungwall. Mungwall also gets upset when a memoryblock is free'ed with a
  53. size different from the one used for allocating the memoryblock, and will
  54. say so. The integrity of the walls will be tested according to the size
  55. specified on allocation time, but will not be free'ed.
  56.  
  57. Pointers passed to FreeMem() will be rejected if they are non-longword
  58. alligned. Thus possible catching bogus pointers otherwise left untouched
  59. by mungwall.
  60.  
  61. Unless a specific task(s) is watched and that task leaves before mungwall
  62. does, mungwall will always lose some memory.
  63.  
  64. NOTES:
  65.  
  66. Other debugging tools which SetFunction() AllocMem() and/or
  67. FreeMem() and JSR to what they think is the old memory routine,
  68. should be run BEFORE mungwall. Mungwall needs to know the returnaddress
  69. of the initial caller. Running other debugging tools after mungwall
  70. will result in false reports about layers.library and invalid
  71. mungwall reports about the caller. The 'scratcher' for example must
  72. be run before mungwall, 'memoration' can be run afterwards, since it
  73. JMP's.
  74.  
  75. When mungwall is being stopped, the walls around the original allocations
  76. which are not free'ed at that point, will never get free'ed, only the block
  77. within. Thus causing memory fragmentation and memoryloss.
  78.  
  79. Memory allocations larger than 3 gigabytes will not be marked by mungwall.
  80.  
  81.  
  82.  
  83. MUNGWALL [UPDATE] [[TASK name][WAIT]] [SNOOP] [NOSNOOP] [NOWAIT] [INFO]
  84.          [MEGASTACK] [NAMETAG] [PRESIZE n] [POSTSIZE n] [FILLCHAR 0xXX]
  85.  
  86. TASK name   - Watch only the task(s), or all but the task(s) specified
  87.               with 'name'. Multiple tasknames are indicated by placing
  88.               a '|' between the names. If the names are preceeded by an
  89.               exclamation mark, all tasks except the ones indicated are
  90.               tracked. ALL is a reserved name, indicating all tasks
  91.               should be tracked. Default ALL.
  92.  
  93. PRESIZE     - Size of wall before memory allocation in bytes. Minimum 4,
  94.               maximum 64. Default 32.
  95.  
  96. POSTSIZE    - Size of wall after memory allocation in bytes. Minimum 4,
  97.               maximum 64. The actual number of bytes after the allocation
  98.               may vary slightly, since it's upped to the nearest longword.
  99.               Default 32.
  100.  
  101. FILLCHAR n  - Character to build the memory wall with. Can be indicated
  102.               both hexadecimal and decimal. Default 0xBB.
  103.  
  104. SNOOP       - Produce snoop compatible output. No snoop output is given
  105.               for illegal FreeMem's. Default OFF. Layers AllocMem's and
  106.               FreeMem's are never snooped. SNOOP is particulary useful
  107.               in combination with TASK. Snoop output can be filtered
  108.               with 'snoopstrip' to find the origin of memory loss.
  109.  
  110. WAIT        - Halt task causing a hit and wait for Ctrl-C. Make sure you
  111.             - can issue a break to the task. WAIT can be used without
  112.               specifying a specific taskname to watch. Default OFF.
  113.  
  114. INFO        - Show configuration information.
  115.  
  116. MEGASTACK   - Show 32 longwords of the stack whenever a hit/snoop occurs
  117.  
  118. NAMETAG     - Tag each allocation with allocating task or command's name
  119.  
  120. UPDATE      - Indicates an already running mungwall task should be up-
  121.               dated with new parameters. Presize, postsize and fillchar
  122.               can never be updated.
  123.  
  124. The following are extra updating parameters.
  125.  
  126. NOSNOOP     - Turn snooping off.
  127.  
  128. NOWAIT      - No longer halt a task in case of an error.
  129.